<template>
  <div class="container">
    <detail-banner :bannerImgUrl="bannerImgUrl" :gallaryImgs="gallaryImgs"></detail-banner>
    <detail-header :sightName="sightName"></detail-header>
    <detail-list :categoryList="categoryList"></detail-list>
  </div>
</template>

<script>
import DetailBanner from './banner/Banner'
import DetailHeader from './header/Header'
import DetailList from './list/List'
import axios from 'axios'
export default {
  data () {
    return {
      bannerImgUrl: '',
      sightName: '',
      gallaryImgs: [],
      categoryList: []
    }
  },
  components: {
    DetailBanner,
    DetailHeader,
    DetailList
  },
  activated () {
    axios.get('/api/detail.json', {
      params: {
        id: this.$route.params.id
      }
    }).then(res => {
      const data = res.data.data
      this.bannerImgUrl = data.bannerImg
      this.sightName = data.sightName
      this.gallaryImgs = data.gallaryImgs
      this.categoryList = data.categoryList
    })
  }
}
</script>

<style lang="stylus" scoped>
  .container
    height 20rem
</style>
